package com.android.infantschool.model.config;

import com.android.infantschool.util.SharedPreferencesUtil;

/**
 * @author Administrator
 * @particulars
 * @time 2019\7\13 0013 14:24
 * @class describe
 */
public class AppConfig {

    /**
     * 设置登录状态
     */
    public static void setLoginStatus(boolean status) {
        SharedPreferencesUtil.setBoolean("login_status", status);
    }

    /**
     * 获取登录状态
     *
     * @return
     */
    public static boolean getLoginStatus() {
        return SharedPreferencesUtil.getBoolean("login_status");
    }

    /**
     * 设置登录类型，密码还是验证码
     */
    public static void setLoginType(int type) {
        SharedPreferencesUtil.setInteger("login_type", type);
    }

    /**
     * 获取登录类型，密码还是验证码
     *
     * @return
     */
    public static Integer getLoginType() {
        return SharedPreferencesUtil.getInteger("login_type");
    }

    /**
     * 记住密码状态
     *
     * @param status
     */
    public static void setRememberPswStatus(boolean status) {
        SharedPreferencesUtil.setBoolean("login_remember_psw", status);
    }

    /**
     * 获取当前是否记住密码
     *
     * @return
     */
    public static boolean getRememberPswStatus() {
        return SharedPreferencesUtil.getBoolean("login_remember_psw");
    }

    /**
     * 保存登录密码
     *
     * @param psw
     */
    public static void setLoginPsw(String psw) {
        SharedPreferencesUtil.setString("login_psw", psw);
    }

    /**
     * 获取登录密码
     */
    public static String getLoginPsw() {
        return SharedPreferencesUtil.getString("login_psw");
    }

    /**
     * 保存登录账号
     *
     * @param user
     */
    public static void setLoginUser(String user) {
        SharedPreferencesUtil.setString("login_user", user);
    }

    /**
     * 获取登录账号
     */
    public static String getLoginUser() {
        return SharedPreferencesUtil.getString("login_user");
    }

    /**
     * 保存Token
     */
    public static void setToken(String token) {
        SharedPreferencesUtil.setString("token", token);
    }

    /**
     * 获取Token
     *
     * @return
     */
    public static String getToken() {
        return SharedPreferencesUtil.getString("token");
    }

    /**
     * 保存用户头像
     */
    public static void setUserPhoto(String userphoto) {
        SharedPreferencesUtil.setString("userphoto", userphoto);
    }

    /**
     * 获取用户头像
     *
     * @return
     */
    public static String getUserPhoto() {
        return SharedPreferencesUtil.getString("userphoto");
    }

    /**
     * 保存用户昵称
     */
    public static void setNickName(String nickName) {
        SharedPreferencesUtil.setString("nickName", nickName);
    }

    /**
     * 获取用户昵称
     *
     * @return
     */
    public static String getNickName() {
        return SharedPreferencesUtil.getString("nickName");
    }

    /**
     * 保存所属幼儿园
     */
    public static void setSchoolName(String SchoolName) {
        SharedPreferencesUtil.setString("schoolName", SchoolName);
    }

    /**
     * 获取所属幼儿园
     *
     * @return
     */
    public static String getSchoolName() {
        return SharedPreferencesUtil.getString("schoolName");
    }

    /**
     * 保存用户手机号
     */
    public static void setUserPhone(String userPhone) {
        SharedPreferencesUtil.setString("userPhone", userPhone);
    }

    /**
     * 获取用户手机号
     *
     * @return
     */
    public static String getUserPhone() {
        return SharedPreferencesUtil.getString("userPhone");
    }

    /**
     * 保存引导页状态
     *
     * @param isWelCome
     */
    public static void setIsWelCome(boolean isWelCome) {
        SharedPreferencesUtil.setBoolean("isWelcome", isWelCome);
    }

    /**
     * 获取引导页状态
     */
    public static boolean getIsWelCome() {
        return SharedPreferencesUtil.getBoolean("isWelcome");
    }
}